﻿<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />
	<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="base/baseJs/baseFilter.js"></script>
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
<link rel="stylesheet" href="static/font-awesome-4.7.0/css/font-awesome.min.css">

<!--  自己的base-->
<link rel="stylesheet" type="text/css" href="static/base/css/index.css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>base-demo</title>
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<header class="navbar-wrapper">




<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/jquery.contextmenu/jquery.contextmenu.r2.js"></script>
<script type="text/javascript" src="static/base/js/menu.js"></script>
<!--<script type="text/javascript" src="base/baseJs/ajax.js"></script>-->
<script type="text/javascript" src="base/ciphertext/jsrsasign-rsa-min.js"></script>
<script type="text/javascript" src="base/ciphertext/jsrsasign/keyutil-1.0.js"></script>
<script type="text/javascript">
$(function(){


    // function hexToBase64(str) {
    //     return btoa(String.fromCharCode.apply(null,
    //         str.replace(/\r|\n/g, "").replace(/([\da-fA-F]{2}) ?/g, "0x$1 ").replace(/ +$/, "").split(" "))
    //     );
    // }
    //
    // function base64ToHex(str) {
    //     for (var i = 0, bin = atob(str.replace(/[ \r\n]+$/, "")), hex = []; i < bin.length; ++i) {
    //         var tmp = bin.charCodeAt(i).toString(16);
    //         if (tmp.length === 1) tmp = "0" + tmp;
    //         hex[hex.length] = tmp;
    //     }
    //     return hex.join(" ");
    // }
     /*签名方法*/
     function doSign() {
         var rsaPrivateKey = "-----BEGIN PRIVATE KEY-----MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAKZGpCo+RMaQdeAthhzRMnrQUM6rF2HsVsdNQYJ0R2W5Eo10baWo6Iy76Cpa6wHHQSOggSIh7BwUjK/MSUYvO0o5a0gBwahrt1m0yhdY07NrOBIEC8UuT3CF//1qRoQ/OaLJZLjX5BeCbjzqyVZxdiIxD58sNb0Oo7kDr9cjrRl5AgMBAAECgYAVhw3YHkm/P5LTXHGBp6AWgIQFzebwGa4+jYUOw8k+pVB+mfVcPlslZWqwmSbWCxsm5q/xYFz2Yb65QAS4noLZarLJ0sUzntT3yU4kXG8UnGp5HJ+EKw0/UhIlFRgjyfKcAl0RFp2kSfhWNxlMYQtwCL+jpalpO0tKIGYp0aSX0QJBAN7KUu0QSX5BiKT4vtAZU3PMP3GaHBMbQPjtxayf6qOuXAfULdIcfHsLmgmQeg8gC0ROUSe5DT2l0UbzVs9F4WUCQQC/D7qnM7J/+4PvzwCoudxQ4BXR70xndpxeK+swp891whFqL/uKFlMFzCseTXu8hcmPoJ4kb6+0X8RTdhskcwCFAkEA1JJRa1Yl+WyH93hLf/0aLhvM0RTNAsH3TUx5VstCsyhTMTkW+yoo77JTKBsNC0900Ji1QGSFqLOFKeBWjPBNLQJBAL5e2chHxo+m+Gs1gp6bsl4TKSqomSRuFpfugsVUL25SFDAN50BLxiV8rWngIm5Rj+hATdJYRmYfFetjPuAuhlECQQCujxHvvXbciMtr/nI60LmrSQOXS/IpQ5xBya7pamAGBAnBFfLXdD60rcAy469KNFQF4dRcuMV1gN/5fNoa1ri9-----END PRIVATE KEY-----";        // initialize
    
         console.log(rsaPrivateKey);
	 	var sig = new KJUR.crypto.Signature({"alg": "SHA256withRSA"});
         // initialize for signature generation
         sig.init(KEYUTIL.getKey(rsaPrivateKey));   // rsaPrivateKey of RSAKey object
         // update data
         sig.updateString("WU2myXcMfW239DLWNjY2m0Cwnwex9qPTHso29cWreK791rdqwbgJ4lCJJZflxY/G9T1rCW0xDrVCnVz4BT13nji4COhofeBE67SJP+JETmEiw0X7HeP/BOiLk0xl/LQDfwT+GaVXm7cCM2cDVczjX3tb+r0aMw5bmVb8rRMhglo=");
         //calculate signature
         console.log(hexToBase64(sig.sign()))
         // return hexToBase64(sig.sign());
     }
    
	 doSign()

</script>

</body>
</html>